import axios from "axios";
import clientConfig from "../config/client_config.js";

//获取记录id
export async function getRecordId() {
    try {
        const result = await axios.get(`${getOrigin(clientConfig.apiPort)}/api/getRecordId`,{ withCredentials: true });
        return result;
    } catch (err) {
        console.log("请求失败：", err);
    }
}

function getOrigin(apiPort) {
    // console.log('process.env', process.env)
    // let hostname = window.location.hostname;
    // return `http://${hostname}:${apiPort}`;
    let hostname = `http://12a28753.r5.cpolar.cn`;
    return `${hostname}`;
}